﻿@using Website.CRUDServices
@using Website.Models.Styling
@using Location = Website.Models.Domain.Location
@model Website.Models.ViewModels.ListView<Activity>
@{
    this.ViewBag.Title = "Netværk";
    this.Layout = "~/Views/_Shared/_Layout.cshtml";
    
}

<div class="float-right smallMarginBottom">
    <input type="button" onclick="@string.Format("location.href = '{0}';", this.Url.Action("NewNetwork"))" value="Opret ny" class="" />
</div>

<table class="tableView">
    <tr>
        @foreach (TableViewHeaderItem item in this.Model.Header.Items)
        {
            <td>
                @Html.Partial("~/Views/_Shared/TableViewHeader.cshtml", item)
            </td>
        }
        <td></td><td></td>
    </tr>
    @if (this.Model != null)
    {
        foreach (Activity act in this.Model.List)
        {

        <tr>
            <td>@string.Format("{0:dd-MM-yyyy}", act.TimeOfActivity)</td>
            <td>
                @if(act.NA.IsConferenceEvent.HasValue && act.NA.IsConferenceEvent.Value){
                    <label>Konference </label>
                }
                else if (act.NA.IsDelegationTravel.HasValue && act.NA.IsDelegationTravel.Value)
                {
                    <label>Delegationsrejse</label>
                }
                else if (act.NA.IsNetworkingEvent.HasValue && act.NA.IsNetworkingEvent.Value)
                {
                    <label>Netværksmøde</label>
                }
                else if (act.NA.IsProductLaunch.HasValue && act.NA.IsProductLaunch.Value)
                {
                    <label>Produkt lancering</label>
                }
            </td>
            <td>@act.NA.ProductType</td>
            <td>
                @if (act.NA.Booth.HasValue && act.NA.Booth.Value)
                {
                    <label>Stand</label>
                }
                @if (act.NA.Attendance.HasValue && act.NA.Attendance.Value)
                {
                    <label>Deltagelse</label>
                }
                @if (act.NA.Organizer.HasValue && act.NA.Organizer.Value)
                {
                    <label>Arrangør</label>
                }
            </td>
            <td>
                <a href="@Url.Action("UpdateNetwork", new { @Id = act.ID })">
                    <img src="@Url.Content("~/Content/ButtonIcons/tool_blue.png")" alt="Link"/></a>
            </td>
            <td>
                <a href="@Url.Action("ViewNetwork", new { @Id = act.ID })">
                    <img src="@Url.Content("~/Content/ButtonIcons/notepad_blue.png")" alt="Link"/></a>
            </td>
        </tr>
        }
    }


    <tr>
        @Html.Partial("~/Views/_Shared/PagingArrows.cshtml", 
            Website.Models.Styling.PagingArrows.GetPagingArrowsFromHeader("Index", 2, this.Model)
        )
    </tr>
</table>
